package com.vcms.view.simulation.uicomponent.listener;

import java.awt.Checkbox;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

import com.vcms.controller.machine.MachinaryController;

public class DoorListener implements ItemListener {
	private MachinaryController machinaryController;

	public DoorListener(MachinaryController machinaryController) {
		this.machinaryController = machinaryController;
	}

	public void itemStateChanged(ItemEvent e) {
		Checkbox cb = (Checkbox) e.getSource();
		machinaryController.setDoorState(cb.getState());
	}
}